/// 应用常量定义类
/// 包含应用名称、版本、路径、字符串等常量
class AppConstants {
  // 私有构造函数，防止实例化
  AppConstants._();

  // 应用信息
  static const String appName = 'Tech Music Player';
  static const String appVersion = '1.0.0';
  static const String appDescription = '科技感音乐播放器';

  // 数据库相关
  static const String databaseName = 'tech_music_player.db';
  static const int databaseVersion = 1;

  // Hive Box名称
  static const String musicBoxName = 'music_box';
  static const String userSettingsBoxName = 'user_settings_box';
  static const String themeConfigBoxName = 'theme_config_box';
  static const String cacheBoxName = 'cache_box';

  // 文件路径
  static const String musicFolderName = 'Music';
  static const String coverArtFolderName = 'CoverArt';
  static const String cacheFolderName = 'Cache';

  // 支持的音频格式
  static const List<String> supportedAudioFormats = [
    '.mp3',
    '.m4a',
    '.aac',
    '.wav',
    '.flac',
    '.ogg',
    '.wma',
  ];

  // 默认值
  static const double defaultVolume = 1.0;
  static const double defaultPlaybackSpeed = 1.0;
  static const int defaultSleepTimerMinutes = 0;
  static const double defaultBassBoost = 0.0;
  static const double defaultVirtualizer = 0.0;

  // 限制值
  static const int maxPlaylistNameLength = 50;
  static const int maxPlaylistDescriptionLength = 200;
  static const int maxRecentPlayedCount = 50;
  static const int maxMostPlayedCount = 50;
  static const int maxSearchHistoryCount = 20;

  // 播放相关
  static const double minPlaybackSpeed = 0.5;
  static const double maxPlaybackSpeed = 2.0;
  static const double playbackSpeedStep = 0.1;
  static const int seekStepSeconds = 10;
  static const double completionThreshold = 0.8; // 播放80%算完成

  // 动画时长（毫秒）
  static const int animationDurationFast = 150;
  static const int animationDurationMedium = 300;
  static const int animationDurationSlow = 500;

  // 网络相关
  static const int networkTimeoutSeconds = 30;
  static const int maxRetryCount = 3;

  // 缓存相关
  static const int maxCacheSize = 100 * 1024 * 1024; // 100MB
  static const int maxCachedMusicCount = 1000;

  // 界面相关
  static const int bottomNavBarItemCount = 5;
  static const double minPlayerHeight = 80.0;
  static const double maxPlayerHeight = 400.0;

  // 搜索相关
  static const int searchDebounceMilliseconds = 500;
  static const int minSearchLength = 1;
  static const int maxSearchLength = 100;
}

/// 应用字符串常量类
class AppStrings {
  AppStrings._();

  // 通用
  static const String ok = '确定';
  static const String cancel = '取消';
  static const String confirm = '确认';
  static const String delete = '删除';
  static const String edit = '编辑';
  static const String save = '保存';
  static const String search = '搜索';
  static const String loading = '加载中...';
  static const String noData = '暂无数据';
  static const String error = '错误';
  static const String success = '成功';
  static const String retry = '重试';
  static const String refresh = '刷新';

  // 导航
  static const String navHome = '首页';
  static const String navLibrary = '音乐库';
  static const String navPlaylists = '播放列表';
  static const String navFavorites = '收藏';
  static const String navSettings = '设置';

  // 播放器
  static const String play = '播放';
  static const String pause = '暂停';
  static const String stop = '停止';
  static const String previous = '上一首';
  static const String next = '下一首';
  static const String shuffle = '随机播放';
  static const String repeat = '重复播放';
  static const String repeatOne = '单曲循环';
  static const String volume = '音量';
  static const String playbackSpeed = '播放速度';

  // 音乐信息
  static const String title = '标题';
  static const String artist = '艺术家';
  static const String album = '专辑';
  static const String duration = '时长';
  static const String genre = '流派';
  static const String year = '年份';
  static const String trackNumber = '音轨号';
  static const String fileSize = '文件大小';
  static const String bitRate = '比特率';
  static const String sampleRate = '采样率';
  static const String unknownArtist = '未知艺术家';
  static const String unknownAlbum = '未知专辑';
  static const String unknownGenre = '未知流派';

  // 播放列表
  static const String playlist = '播放列表';
  static const String createPlaylist = '创建播放列表';
  static const String playlistName = '播放列表名称';
  static const String playlistDescription = '播放列表描述';
  static const String addToPlaylist = '添加到播放列表';
  static const String removeFromPlaylist = '从播放列表移除';
  static const String emptyPlaylist = '播放列表为空';

  // 收藏
  static const String favorite = '收藏';
  static const String unfavorite = '取消收藏';
  static const String favorites = '我的收藏';
  static const String addToFavorites = '添加到收藏';
  static const String removeFromFavorites = '从收藏移除';
  static const String emptyFavorites = '暂无收藏音乐';

  // 历史记录
  static const String history = '播放历史';
  static const String recentlyPlayed = '最近播放';
  static const String mostPlayed = '最常播放';
  static const String clearHistory = '清空历史';
  static const String emptyHistory = '暂无播放历史';

  // 音乐库
  static const String musicLibrary = '音乐库';
  static const String scanMusic = '扫描音乐';
  static const String scanning = '正在扫描...';
  static const String scanComplete = '扫描完成';
  static const String scanFailed = '扫描失败';
  static const String emptyLibrary = '音乐库为空';
  static const String refreshLibrary = '刷新音乐库';

  // 搜索
  static const String searchMusic = '搜索音乐';
  static const String searchHint = '搜索歌曲、艺术家或专辑';
  static const String searchResults = '搜索结果';
  static const String noSearchResults = '未找到相关音乐';
  static const String searchHistory = '搜索历史';
  static const String clearSearchHistory = '清空搜索历史';

  // 设置
  static const String settings = '设置';
  static const String theme = '主题';
  static const String themeMode = '主题模式';
  static const String lightTheme = '浅色主题';
  static const String darkTheme = '深色主题';
  static const String systemTheme = '跟随系统';
  static const String audioQuality = '音质';
  static const String lowQuality = '低音质';
  static const String mediumQuality = '中音质';
  static const String highQuality = '高音质';
  static const String losslessQuality = '无损音质';
  static const String showLyrics = '显示歌词';
  static const String autoPlay = '自动播放';
  static const String sleepTimer = '睡眠定时器';
  static const String equalizer = '均衡器';
  static const String bassBoost = '低音增强';
  static const String virtualizer = '虚拟环绕';

  // 权限
  static const String permissionRequired = '需要权限';
  static const String storagePermission = '存储权限';
  static const String storagePermissionDescription = '需要存储权限来扫描和播放音乐文件';
  static const String grantPermission = '授予权限';
  static const String permissionDenied = '权限被拒绝';

  // 错误信息
  static const String errorPlayingMusic = '播放音乐时出错';
  static const String errorLoadingMusic = '加载音乐时出错';
  static const String errorScanningMusic = '扫描音乐时出错';
  static const String errorSavingData = '保存数据时出错';
  static const String errorLoadingData = '加载数据时出错';
  static const String errorNetworkConnection = '网络连接错误';
  static const String errorFileNotFound = '文件未找到';
  static const String errorInvalidFile = '无效的文件格式';
  static const String errorDatabaseOperation = '数据库操作错误';

  // 成功信息
  static const String successPlaylistCreated = '播放列表创建成功';
  static const String successMusicAdded = '音乐添加成功';
  static const String successMusicRemoved = '音乐移除成功';
  static const String successSettingsSaved = '设置保存成功';
  static const String successDataCleared = '数据清空成功';

  // 确认对话框
  static const String confirmDeletePlaylist = '确定要删除这个播放列表吗？';
  static const String confirmClearHistory = '确定要清空播放历史吗？';
  static const String confirmClearLibrary = '确定要清空音乐库吗？';
  static const String confirmDeleteMusic = '确定要删除这首音乐吗？';

  // 提示信息
  static const String tipScanMusic = '点击扫描按钮来添加本地音乐';
  static const String tipCreatePlaylist = '创建播放列表来整理你的音乐';
  static const String tipAddToFavorites = '点击心形图标收藏喜欢的音乐';
  static const String tipAdjustSettings = '在设置中调整播放偏好';
}

/// 路由名称常量
class AppRoutes {
  AppRoutes._();

  static const String splash = '/splash';
  static const String home = '/home';
  static const String player = '/player';
  static const String library = '/library';
  static const String playlists = '/playlists';
  static const String playlistDetail = '/playlist-detail';
  static const String favorites = '/favorites';
  static const String history = '/history';
  static const String search = '/search';
  static const String settings = '/settings';
  static const String about = '/about';
}

/// 资源路径常量
class AppAssets {
  AppAssets._();

  // 图片
  static const String logoPath = 'assets/images/logo.svg';
  static const String defaultCoverPath = 'assets/images/default_cover.svg';
  static const String placeholderPath = 'assets/images/placeholder.svg';

  // 动画
  static const String loadingAnimationPath = 'assets/animations/loading.json';
  static const String musicAnimationPath = 'assets/animations/music.json';
  static const String waveAnimationPath = 'assets/animations/wave.json';

  // 音频
  static const String silencePath = 'assets/audio/silence.mp3';

  // Mock数据
  static const String mockMusicDataPath = 'assets/mock_data/music_data.json';
  static const String mockPlaylistDataPath =
      'assets/mock_data/playlist_data.json';
}
